package com.yitao.cms.enums;

/**
 * @Auther: wuWenlong
 * @Date: 2018/5/31 0031 14:17
 * @Description:
 */
public class PermissionEnums {
    /**
     * 菜单
     */
    public enum pathType{
        PARENT_MENU(0,"父菜单"),
        SUBMENU(1,"子菜单");

        private Integer code;
        private String desc;

        pathType(Integer code,String desc){
            this.code = code;
            this.desc = desc;
        }

        public Integer getCode() {
            return code;
        }


        public String getDesc() {
            return desc;
        }

        public static String getDescByCode(Integer Code){
            for (pathType e : pathType.values()) {
               if (e.getCode() .equals(Code) ){
                   return e.getDesc();
               }
            }
            return null;
        }

    }
    /**
     * 菜单类型
     */
    public enum resourceType{
        menu("0","菜单"),
        button("1","button");
        private String code;
        private String desc;

        resourceType(String code,String desc){
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }


        public String getDesc() {
            return desc;
        }

        public static String getDescByCode(String Code){
            for (resourceType e : resourceType.values()) {
                if (e.getCode() .equals(Code) ){
                    return e.getDesc();
                }
            }
            return null;
        }
    }
    /**
     * 菜单状态枚举
     */
    public enum permissionStatusEnum{
        /* 禁用 */
        DISABLE("0","禁用"),
        /* 启用 */
        ENABLE("1","启用");
        private String code;
        private String desc;

        permissionStatusEnum(String code,String desc){
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }


        public String getDesc() {
            return desc;
        }

        public static String getDescByCode(String Code){
            for (permissionStatusEnum e : permissionStatusEnum.values()) {
                if (e.getCode() .equals(Code) ){
                    return e.getDesc();
                }
            }
            return null;
        }
    }
}
